home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Games Collection 1 / software vault.zip / software vault / CDR02 / DCGAMES1.ZIP / NEWGAME.ZIP / GUARD.SCR < prev    next >
Text File  |  1993-04-01  |  4KB  |  181 lines

  1. !
  2. ! Default Guard's script
  3. !
  4. ! (c) DC Software, 1992
  5. !
  6. ! Pending Enhancements
  7. !
  8. ! - I need to create a voice file (.VFL) with voices for this script.
  9. !   Look at the 'voice()' entries to see what voices it would play if
  10. !   they were available.  These voices could even be placed in the
  11. !   system's voice file (DCSOUNDS.VFL) in which case the voice command
  12. !   should read 'voice( xxxx, 1000 )'.
  13. !
  14.  
  15. !------------------------------------------------------------------------!
  16. :@TALK ! Talk to the character !
  17. !------------------------------------------------------------------------!
  18.  
  19.   if npc.v1 = 1 then
  20.     writeln( "Hello again.  How may I help you?" );
  21.     GOTO CHAT;    ! Once a password is given, just talk !
  22.   endif;
  23.  
  24.   if npc.v1 = 2 then
  25.     writeln( "Can't you see I'm off duty?  Get lost.." );
  26.     GOTO CHAT1;
  27.   endif;
  28.  
  29.   if npc.v0 = 0 then
  30.     writeln( "Halt!  Identify yourself!" );
  31.     voice( "Halt1" );
  32.   else
  33.     writeln( "I told you to get lost!  What are you doing back here?" );
  34.     voice( "Halt2" );
  35.   endif;
  36.  
  37.   npc.v0 = 1;   ! We've been here !
  38.   L0 = 0;       ! Count number of bribe attempts !
  39.   L1 = 0;       ! Count number of password attempts !
  40.  
  41. :LOOP
  42.   L3 = select( "Leave","Fight Guard","Give Money","Give Password","Talk" );
  43.   ON L3 GOTO XLEAVE, XFIGHT, BRIBE, PSWRD, TRYCHAT;
  44.  
  45. :XLEAVE
  46.   writeln( "And don't come back!" );
  47.   STOP;
  48.  
  49. :TRYCHAT
  50.   writeln( "No unauthorized person is allowed in this area.." );
  51.   writeln( "Please leave." );
  52.   goto LOOP;
  53.  
  54. !
  55. ! Fight with the guard..
  56. !
  57. :XFIGHT
  58.   writeln( "You asked for it!" );
  59.   voice( "Fight" );
  60.   npc.type = HOSTILE;
  61.   FIGHT;
  62.  
  63. !
  64. ! Bribe the guard..
  65. !
  66. :BRIBE
  67.   if npc.value = 0 GOTO NOBRIBE; ! Can't bribe this guy.. !
  68.  
  69.   writeln( "You try to bribe the guard.." );
  70.   L4 = getnum("How much do you give?") * 10; ! Convert GOLD to silver !
  71.  
  72.   if L4 < npc.value then
  73.     writeln( "It would take a LOT more than ", $L4, " gold pieces.." );
  74.     voice( "More" );
  75.     goto LOOP;
  76.   endif;
  77.  
  78.   if L4 > group.gold then
  79.     writeln( "You don't have enough gold." );
  80.     voice( "Broke" );
  81.     goto LOOP;
  82.   endif;
  83.  
  84.   writeln( "Now that I think about it, it's time for my break.." );
  85.   voice( "Bribe" );
  86.   dec( group.gold, L4 );
  87.   npc.v1 = 2;
  88.   STOP;
  89.  
  90. :NOBRIBE
  91.   if L0 > 0 GOTO XFIGHT;
  92.   writeln( "Leave now, before I get really mad.." );
  93.   voice( "NoBribe" );
  94.   inc( L0 );
  95.   goto LOOP;
  96.  
  97. !
  98. ! Give the password
  99. !
  100. :PSWRD
  101.  
  102.   writeln( "What is the password?" );
  103.   L3 = getstr(); ! The Password !
  104.   if s4 for 8 = s0 then
  105.     writeln( "Thank you. You are now authorized to pass." );
  106.     voice( "Pass" );
  107.     npc.v1 = 1;              ! Disactivates guard feature !
  108.     STOP;
  109.   endif;
  110.  
  111.   ON L1 GOTO PSWRD1,PSWRD2,PSWRD3;
  112.   writeln( "I warned you!" );
  113.   voice( "Fight" );
  114.   FIGHT;
  115.  
  116. :PSWRD1
  117.   writeln( "You'd better leave now.." );
  118.   voice( "NoPass" );
  119.   inc(L1);
  120.   GOTO LOOP;
  121.  
  122. :PSWRD2
  123.   writeln( "Trying to guess the password is a bad idea.." );
  124.   voice( "NoPass" );
  125.   inc(L1);
  126.   GOTO LOOP;
  127.  
  128. :PSWRD3
  129.   writeln( "This was your last chance.  Leave now!" );
  130.   voice( "NoPass" );
  131.   inc(L1);
  132.   GOTO LOOP;
  133.  
  134. !
  135. ! Handle conversations..
  136. !
  137. :CHAT
  138.   writeln( "How may I help you?.  Please make it brief, I'm on duty." );
  139.  
  140. :CHAT1
  141.   L3 = getstr("Name","Password","Job","Bye");
  142.   if L3 = -1 then 
  143.     writeln( "Ok." );
  144.     STOP;
  145.   endif;
  146.  
  147. ! First, see if the keyword typed is in the character's text block !
  148.   if dotext( S0 ) goto CHAT1;
  149.  
  150. ! It didn't, so try the predefined ones..
  151.   on L3 goto CNAME, CPASS, CJOB, CSTOP;
  152.  
  153. ! Nope, try a 'DEFAULT' line
  154.   if not dotext( "DEFAULT" ) then
  155.     writeln( "I don't know anything about that!" );
  156.   endif;
  157.   goto CHAT1;
  158.  
  159. :CNAME
  160.    writeln( "My name is ", NPC.name, "."     );
  161.    GOTO CHAT1;
  162.  
  163. :CPASS
  164.    if npc.v1 = 2 then
  165.      writeln( "Can't you see I'm busy?" );
  166.    else
  167.      writeln( "You only have to give it once." );
  168.    endif;
  169.    GOTO CHAT1;
  170.  
  171. :CJOB
  172.    writeln( "I am a guard!"                  );
  173.    GOTO CHAT1;
  174.  
  175. :CSTOP
  176.    writeln( "You're welcome.."               );
  177.    STOP;
  178.  
  179. ! Feel free to expand on this list.. !
  180.  
  181.